<?php
@require("php_config_init.php");
@require("php_config_mysql.php");
$userid = $_GET["userid"];
//sql语句
$sql = "select id,name,area,userid,address,tel from address_info where status = 1 and userid = '$userid'";
//执行sql语句
$result = mysql_query($sql);
//解析一行数据，没有返回false
$list = array();
while($item = mysql_fetch_array($result)){
    $temp = array();
    $temp["id"] = $item["id"];
    $temp["name"] = $item["name"];
    $temp["area"] = $item["area"];
    $temp["userid"] = $item["userid"];
    $temp["address"] = $item["address"];
    $temp["tel"] = $item["tel"];
    $list[] = $temp;
}
echo json_encode($list);
?>